package com.meng.baselibrary.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;


/**
 * Created by Administrator on 2017/5/4.
 */

public abstract class BaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView();
        initTitle();
        initView();
        initData();
    }
    protected abstract void setContentView();
    protected abstract void initTitle();
    protected abstract void initView();
    protected abstract void initData();
    protected  void startActivity(Class<?> clazz){
        Intent intent = new Intent(this,clazz);
        startActivity(intent);
    }
    protected <T extends View> T findViewByIdNoCast(int viewId){
        return (T) findViewById(viewId);
    }
}
